﻿#pragma once

/* hid 上层接口抽象类，真正与 hid 进行通讯的类继 */
class hid_interface {
public:
  /* 默认析构函数 */
  virtual ~hid_interface() = default;

  /* 打开 HID 设备 */
  virtual int open(unsigned short vendor_id, unsigned product_id) = 0;

  /* 读取数据 */
  virtual int read(char *data, int length) = 0;

  /* 写数据 */
  virtual int write(char *data, int length) = 0;

  /* 0关闭 1打开 */
  virtual int isOpen() = 0;

  /* 关闭 HID 设备*/
  virtual int close() = 0;
};
